package gapp.ctrl;

import java.util.HashMap;
import java.util.Map;

import javax.swing.Action;

public final class ControlFactory {

	public enum Ctrl {
		SERVICE_CTRL,
		STATE_CTRL;
	}

	private final static Map<Ctrl, Action> ctrls = new HashMap<Ctrl, Action>();
	static {		
		ctrls.put(Ctrl.SERVICE_CTRL, new ServiceCtrl("Servic call"));
		ctrls.put(Ctrl.STATE_CTRL, new StateCtrl("Change state"));
	}

	public static Action getControl(Ctrl ctrl) {
		if( ctrl == null ){
			throw new IllegalArgumentException("Control null");
		}
		return ctrls.get(ctrl);
	}

}
